#include<iostream>
using namespace std;
typedef long long LL;
const int N = 1e5 + 10;
int n, m;
int arr[N];
long long tree[N];
int lowbit(int x)
{
	return x & -x;
}

void add(int x, int c)
{
	for (int i = x; i <= n; i += lowbit(i)) {
		tree[i] += c;
	}
}

LL  query(int x)
{
	LL res = 0;
	for (int i = x; i; i -= lowbit(i)) {
		res += tree[i];
	}
	return res;
}
int main()
{
	cin >> n >> m;
	for (int i = 1; i <= n; i++) {
		cin >> arr[i];
		add(i, arr[i] - arr[i - 1]);
	}
	while (m--) {
		char op[2];
		int l, r, d;
		cin >> op >> l;
		if (op[0] == 'C') {
			cin >> r >> d;
			add(l, d);
			add(r + 1, -d);
		}
		else {
			cout << query(l) << endl;
		}
	}
	return 0;
}